UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sQ358o1+Ih/WdvhYXqFEmStQ+HoIRL5GIaDexxZ428w=' 
WHERE 
  key_id = 'af6023929cd6e662b7100861c37fb7225bf84dc9e975694dd60477c2c0b57c08' 
  AND (
    token = 'sQ358o1+Ih/WdvhYXqFEmStQ+HoIRL5GIaDexxZ428w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041