UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JkZIOysfzapLvyK3/yHlURyxwBRa9f0RW9F0tJ0npzY='
WHERE
key_id = '81d7fc3fa11b5531ca34e6dbe2754e9fa7e12cf9d65b673ffcb83ea6465b957f'
AND (
token = 'JkZIOysfzapLvyK3/yHlURyxwBRa9f0RW9F0tJ0npzY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)