UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CPN8LAhzqig7cuqmCkcMek/qUI0wCPrUY94IHnyhKIg=' 
WHERE 
  key_id = '32fb84e01e2daa41916f8825c8e98173067c408fef3db66884aefdd2e8ecd4b5' 
  AND (
    token = 'CPN8LAhzqig7cuqmCkcMek/qUI0wCPrUY94IHnyhKIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039