UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wDhB5GOlntLW8ArAN7tSS5+ffFFpRX5DR/mRmpIrvbU='
WHERE
key_id = '798950b26f0c88ff99670f1fbab21b5ce7338094ff1777f842eaf790784434c9'
AND (
token = 'wDhB5GOlntLW8ArAN7tSS5+ffFFpRX5DR/mRmpIrvbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)