UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BtrfapO/FUaG5TdEe30C0S7Rjv0uOaQ+Y6+/G6gs450='
WHERE
key_id = '01c0a37232bd03265adeb712a7034bc6db45cd3f7073a8a37d79f27e1e4435cf'
AND (
token = 'BtrfapO/FUaG5TdEe30C0S7Rjv0uOaQ+Y6+/G6gs450='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)