UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ba40PCYc7CkwnlLwo92kMm/PKhEtYYJYvPQ/NBktq2U=' 
WHERE 
  key_id = '4e23475645d56ac5f93ba997dc899f088ad7be9766003fbc71c609b9edb9dc3d' 
  AND (
    token = 'Ba40PCYc7CkwnlLwo92kMm/PKhEtYYJYvPQ/NBktq2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028