UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v8dkvx2MapR3fG2mVXrIHKcVzq/EEW9pnNjT89EIlxA=' 
WHERE 
  key_id = '5d92219e0659649fe6f62f7e16d70f557d078487052cb39c870ce3c4e88b8416' 
  AND (
    token = 'v8dkvx2MapR3fG2mVXrIHKcVzq/EEW9pnNjT89EIlxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065