UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L7gdyVrhG4niepjm2SUGA55Bd6eP/xzi3YrFrktt0zo=' 
WHERE 
  key_id = '0c96301f9ff72c35325d76541e32665f43f094969bc2584f191ec59b51ac9c3a' 
  AND (
    token = 'L7gdyVrhG4niepjm2SUGA55Bd6eP/xzi3YrFrktt0zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039