UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9iRXcxj1GqRS3RV+IdR/bTRzGVNURznrBdAe6L0RAIg=' 
WHERE 
  key_id = '3a6306fb3b05f408d9f6a1277a705ed724cdfbc29ef574b61c822ac6aee004a0' 
  AND (
    token = '9iRXcxj1GqRS3RV+IdR/bTRzGVNURznrBdAe6L0RAIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042