UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y3e3stY29Q7Lju4IOIlm3j9eIYJZ8ZqCE/mU+aridFs=' 
WHERE 
  key_id = 'e26d92e46da39f3f3bb6aa6ae69e1bedaf9e4600f66dbf367877249b337420ae' 
  AND (
    token = 'y3e3stY29Q7Lju4IOIlm3j9eIYJZ8ZqCE/mU+aridFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018