UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LTgdu0poMxJdeQntmNHBAY2cOSGa2CI17WtCgNSExJU=' 
WHERE 
  key_id = '2a6aa8477afd45b239c21962eb13d8b6e234f01cabfff744b0e0a401f658b93f' 
  AND (
    token = 'LTgdu0poMxJdeQntmNHBAY2cOSGa2CI17WtCgNSExJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026