UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LJpqVgnOzuSrAB82826vsjsCPzCOx0jhys801iTiplI=' 
WHERE 
  key_id = '416d920d7f5f60dd36dc65e831c1336b1b928524f7ed8b0bf0b4dc41735655ec' 
  AND (
    token = 'LJpqVgnOzuSrAB82826vsjsCPzCOx0jhys801iTiplI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036