UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0o5yFODNO/djqWNPNvLK0KYMhmr8sxFuKzMGmQyDaRA=' 
WHERE 
  key_id = '488a424b73086837305cb3080474cd1de7cee41a3d9a9ed7e908237d74beac69' 
  AND (
    token = '0o5yFODNO/djqWNPNvLK0KYMhmr8sxFuKzMGmQyDaRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026