UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xUfNodKVEOpiSjagFVAFzOqF0eaQDxO5doNjKuaCVpg=' 
WHERE 
  key_id = 'c5bdc4c7fc9aa51c41d970c9a239019fc70891bd92358e72e9f4a096a4991459' 
  AND (
    token = 'xUfNodKVEOpiSjagFVAFzOqF0eaQDxO5doNjKuaCVpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026