UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qoO+TiXOCvvqFKXAYmaBq8CFjfpMLxFjB2ikrbXCy/E='
WHERE
key_id = 'a8ef9b17194f2e3088c8f9ea2a4986cb6b920308fa2c2fa24385ba2123333ea5'
AND (
token = 'qoO+TiXOCvvqFKXAYmaBq8CFjfpMLxFjB2ikrbXCy/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)