UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nWxWBDOeTcJKpgGxJxodl/pQGkJRe9CbeHZ2jYpW0ew=' 
WHERE 
  key_id = '4b6aed4d5045d04f1c6cdc888aa484eb53b2e9413bdcef9d32303de99a2011cb' 
  AND (
    token = 'nWxWBDOeTcJKpgGxJxodl/pQGkJRe9CbeHZ2jYpW0ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048