UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KKCRzusUZ5B3EDaQNHbyFjNLpey9gnJXrXcIw2ERcqM=' 
WHERE 
  key_id = '961d969288a14b2dd64ba750b21a94903ba61f52762ce5f35d33778dbcb9834d' 
  AND (
    token = 'KKCRzusUZ5B3EDaQNHbyFjNLpey9gnJXrXcIw2ERcqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017