UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CAfJNNim2NUdRSEZIQiAAnYzOmxm0bf0MVe3fKqlzTM=' 
WHERE 
  key_id = '1fa4738a5437b77a0d141669c94305aab5c423d7582e024ee89674fb90695d3e' 
  AND (
    token = 'CAfJNNim2NUdRSEZIQiAAnYzOmxm0bf0MVe3fKqlzTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041