UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hvfRAqw06z0KoWQkA+ILDaZGgWq0d9LA9aI7PpeNyg='
WHERE
key_id = '8c45915ad030629b2ad39024d6257aaa27f44b0a63efb1f66cec22aca24ff69b'
AND (
token = '3hvfRAqw06z0KoWQkA+ILDaZGgWq0d9LA9aI7PpeNyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)