UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/tSt/7yYEOdXnJdf9yE+HZnBkElCEZJiNnm4WUs/zN4=' 
WHERE 
  key_id = '3f720f0e8e9805d2cd49244c6a0911998309e886e04782635bdf72f90e40bf92' 
  AND (
    token = '/tSt/7yYEOdXnJdf9yE+HZnBkElCEZJiNnm4WUs/zN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046