UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yQ1dx8OiiFh4DJDKqPsNaGsTPtRfjc+JN1dYtUNE4VE=' 
WHERE 
  key_id = 'cca9fec8705caa42508c2d7ba34fec39c6f5fb577481d69715a4bf77dbaa830c' 
  AND (
    token = 'yQ1dx8OiiFh4DJDKqPsNaGsTPtRfjc+JN1dYtUNE4VE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00097