UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lwDp9lkbtTJdZFcFTsuY2ed7V2uVQo2WpkOW6JH/V4c=' 
WHERE 
  key_id = '5bbbee5fa53569f9198e279cd63a6b5eb52008be8e4dea6f69f245b0297ee77a' 
  AND (
    token = 'lwDp9lkbtTJdZFcFTsuY2ed7V2uVQo2WpkOW6JH/V4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033