UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0ZFGpLb76AYV5tQtnI1mqwc6vLanILLsjYN58u5c3kk='
WHERE
key_id = '81cdb2a59c6a7e203b35ca005c3fd71a5a08619c121cb456a96fddbb0dca2c02'
AND (
token = '0ZFGpLb76AYV5tQtnI1mqwc6vLanILLsjYN58u5c3kk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)