UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qg08lhyvEh5BHIRw5nMiETCIfOHVqtQy+CwakvPdTPc=' 
WHERE 
  key_id = '0d67d3892583e00121caa1c4c6cc8915b6640d18439d6930691e5498baa7ea35' 
  AND (
    token = 'qg08lhyvEh5BHIRw5nMiETCIfOHVqtQy+CwakvPdTPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035