UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ECYV9t70uWGZ68zbl2aL93YZCotQerBlAUcB87efqN0=' 
WHERE 
  key_id = '79aa394cb97cc3ab978af17cf7922746d4bdcac3da05efbae73134bf1e5e0816' 
  AND (
    token = 'ECYV9t70uWGZ68zbl2aL93YZCotQerBlAUcB87efqN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021