UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hAXKaELPwjU0Tj4V0Um1b3ZQdLA/VanYqtUFa+sRaBs='
WHERE
key_id = '3bf349f5d45857b0559abab57c2e658f4c4f64a7263c78f69803ce946283b5d6'
AND (
token = 'hAXKaELPwjU0Tj4V0Um1b3ZQdLA/VanYqtUFa+sRaBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)