UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K9g+CAnoLnT9F3D7zphnQp+4fJHlKB/TmXKfbXy3qZA=' 
WHERE 
  key_id = '2844c931ca53b775a46ddf0ba9e9c0589e582204b1fc4533b6b54f4629534cc3' 
  AND (
    token = 'K9g+CAnoLnT9F3D7zphnQp+4fJHlKB/TmXKfbXy3qZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057