UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZYFa3pLG4S3Vt9o1j8kf0S26gWy7gPsaDxnUGXdfrYY=' 
WHERE 
  key_id = '5b0c3569720fa3e0bea267fa92ab2742ac99713b5b4e917c0569e44698a2ab39' 
  AND (
    token = 'ZYFa3pLG4S3Vt9o1j8kf0S26gWy7gPsaDxnUGXdfrYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047