UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rg2QZo43oNPS4TgNSs3E9Dzv74c3Ve3y5gmYk38tLuY=' 
WHERE 
  key_id = '19e60efc5023434d2cbdd41d834b090e4daf23ede8d53b93a11771597756cd94' 
  AND (
    token = 'rg2QZo43oNPS4TgNSs3E9Dzv74c3Ve3y5gmYk38tLuY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060