UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lWyog5HPaf1EdlFXJ/ILctohm3+Ob4mNy2LJBOboYtY='
WHERE
key_id = 'cabd9d1fb933a5dbf47167ef2464240f00828f54ff6cb603375d3639852e2adc'
AND (
token = 'lWyog5HPaf1EdlFXJ/ILctohm3+Ob4mNy2LJBOboYtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)