UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9qKVvpaqNwH1fZZQRJbhWtSDBz4nhMw1JrX7dE139n8='
WHERE
key_id = 'fef5211775cd6d39b344b4f2d77a51525b3a12fb66b72fdf53d969a68e973080'
AND (
token = '9qKVvpaqNwH1fZZQRJbhWtSDBz4nhMw1JrX7dE139n8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)