UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd9XH53h6kF5pl4435Li8piwqi+rXLuAUMRsGsTEvqpE=' 
WHERE 
  key_id = '7953523e76d4972e28ac02704bf388c73ecbf9f7e035681ced54b3f53fcdc811' 
  AND (
    token = 'd9XH53h6kF5pl4435Li8piwqi+rXLuAUMRsGsTEvqpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041