UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7LMOq2JvdfuOAQrYp6mDxLIi0G7xSfKP1feKRFsGePE=' 
WHERE 
  key_id = '93fc959f817683c01b32ae95861264ef1a7520af9dfba20464dece3e9afe14de' 
  AND (
    token = '7LMOq2JvdfuOAQrYp6mDxLIi0G7xSfKP1feKRFsGePE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025