UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qMHCatXctXyW9jOwylrZ/rONUuv/p84mpnm43sVtzAI='
WHERE
key_id = '0e2c09def6789543fb35db8e1afc6abf4aea150c950c9932af5a24f9ddaa19d2'
AND (
token = 'qMHCatXctXyW9jOwylrZ/rONUuv/p84mpnm43sVtzAI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)