UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k/HmLudbJsKH3+jFWUk8nlCFiHcq6mJc8Pups2y6oWI='
WHERE
key_id = '91cc78b2790e7d460ba4839cdcac1b90376e0615b669783e9eb5afa0ef2589ea'
AND (
token = 'k/HmLudbJsKH3+jFWUk8nlCFiHcq6mJc8Pups2y6oWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)