UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n+UcVgfGmmj4UuvBTYa9KhcpH6ZhxOnY0dMndnVnvDM='
WHERE
key_id = '88bc859f20a9b78b4c2c95509f5bb7adeb72ba420f59cf8426f27cebd5f0e8c6'
AND (
token = 'n+UcVgfGmmj4UuvBTYa9KhcpH6ZhxOnY0dMndnVnvDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)