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

Query time 0.00041