UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c5drsTch0MxI3esq9r6nuLhWCrYj6a2D25nLCVJ9MlY=' 
WHERE 
  key_id = 'b292f848b0b556422f89e6db57dec19c034552fc8c15800e2d23eb9129ad61c8' 
  AND (
    token = 'c5drsTch0MxI3esq9r6nuLhWCrYj6a2D25nLCVJ9MlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028