UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xoLwdqVbz9h5cQ5ctpdEPZiZr7dwWCf2hWhG6eVJAUA=' 
WHERE 
  key_id = '71c11c8c7ea516d27eac3fe749955315a2ba9634fc6a9e6a1b2271d713993624' 
  AND (
    token = 'xoLwdqVbz9h5cQ5ctpdEPZiZr7dwWCf2hWhG6eVJAUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027