UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Dz1A3inCn7xkAZiEIzFJJqC4bgbcCTOxH10M0PFJo0=' 
WHERE 
  key_id = '99c5b94de3f6f6d43f4acf25472aaee3634f927b1ffc485be465decdd0b9f455' 
  AND (
    token = '+Dz1A3inCn7xkAZiEIzFJJqC4bgbcCTOxH10M0PFJo0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036