UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UpOpLsUl8W9gTvl8bCtRGnILFEIfKi1rft2hJR/Aal0='
WHERE
key_id = '43c152cb7f012b3762dd4c2de676efb8de72c92a55f34e3ae540e80d2f2e7d07'
AND (
token = 'UpOpLsUl8W9gTvl8bCtRGnILFEIfKi1rft2hJR/Aal0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)