UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bf0ydEUY2/HmfCnfKRnlMAJ4q7h5viWdlK6io7ILjic=' 
WHERE 
  key_id = '534add323c7b2827a3d66f35b708116ac2b2ea37a87698a9184a35c93dab859c' 
  AND (
    token = 'Bf0ydEUY2/HmfCnfKRnlMAJ4q7h5viWdlK6io7ILjic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046