UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1vvxV0aQ4JGA3FrVvgXHDXb8KPbWve6KvBlO+g39lpE='
WHERE
key_id = 'fe5174c5b1d9d63aede06ab4f94d8381f866e3c1a6edeb2b81b61e93d61cb0f9'
AND (
token = '1vvxV0aQ4JGA3FrVvgXHDXb8KPbWve6KvBlO+g39lpE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)