UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FVOlp90RQPK033fyCj5KFwWduGP59qnUbJPHUDSazoQ=' 
WHERE 
  key_id = 'b4f5d7f031f30a560aca2e8e2282ff7d8b276c75f0682fb17ba409b0f50fe10b' 
  AND (
    token = 'FVOlp90RQPK033fyCj5KFwWduGP59qnUbJPHUDSazoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018