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