UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hG72Ie5x++IeqIbuMLmx0w207BzsRJ0qw/EPnVN4LMI='
WHERE
key_id = 'a0562d03cbcce694629e4c74c1ed8b6d8df63c6fbd20ffa0c7ebef383a566383'
AND (
token = 'hG72Ie5x++IeqIbuMLmx0w207BzsRJ0qw/EPnVN4LMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)