UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0QrmBJXBdNWjhfFqEL79T7kb1GIJzBZzxI65i9IbTtM=' 
WHERE 
  key_id = '9da40e9396d48a55f327a0209d9ad3e1fb4bbb9f3a240118731b898bc1894299' 
  AND (
    token = '0QrmBJXBdNWjhfFqEL79T7kb1GIJzBZzxI65i9IbTtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025