UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KJla2Z/k2IAozDNysI4jXgDQXVG8yI0wSgY+DsSaecc=' 
WHERE 
  key_id = '0fb6df60fab87ff769a6a58d69ecf8123790cbf589aabefdf3424dbc31e9f18b' 
  AND (
    token = 'KJla2Z/k2IAozDNysI4jXgDQXVG8yI0wSgY+DsSaecc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019