UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GSE2ZffjHcuN4WTXjHyGOrpl/VfxohTiYbIEyYqCBnI=' 
WHERE 
  key_id = '5a38a6b5e8669898a36c9bc86a6e2e76469c492705ce4aa28fe797f9f98663e6' 
  AND (
    token = 'GSE2ZffjHcuN4WTXjHyGOrpl/VfxohTiYbIEyYqCBnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035