UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vk8MrXuGANkZv68UFjPt1Vf2CwB24oq45x07utNyocQ='
WHERE
key_id = '292b49bc7fdc15044fb9bffc2a101cf239c8f05249aad5c44b98257aa2ac60cd'
AND (
token = 'Vk8MrXuGANkZv68UFjPt1Vf2CwB24oq45x07utNyocQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)