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

Query time 0.00035