UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UKWetjuUFmud6ZJmeWGfGVkUJyH58nopP5vbgyWx11E=' 
WHERE 
  key_id = '2ef8f360d881cd63507447aed529c70163867e66fc8d97d523e8660e0b9ea652' 
  AND (
    token = 'UKWetjuUFmud6ZJmeWGfGVkUJyH58nopP5vbgyWx11E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015