UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm4JToHPXl+7nx/gCROSLuffsqSD5jS8tBA0B7gcvirg='
WHERE
key_id = '76e3719e57172338407ffa4bfe0719d8bc6fd3a99d26f2315db7b18efaff965c'
AND (
token = 'm4JToHPXl+7nx/gCROSLuffsqSD5jS8tBA0B7gcvirg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)