UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0ml7YPziwdTJcEhrHQ6SgRuEvOBivS/90aj9KlVM2Ww='
WHERE
key_id = '2606354de9dce8bfd698b7533f7e2e36d6226070bbfa387a6e0a64a6fd904166'
AND (
token = '0ml7YPziwdTJcEhrHQ6SgRuEvOBivS/90aj9KlVM2Ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)