UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mq7SH21A9aDIwldHWcH2TNIUi1nSbWoB/qJkmj4nfaU='
WHERE
key_id = '28037749456c2d72b5d0b700386749ee1b3dec4b4fb2a9214639f7f93d1fbeaa'
AND (
token = 'mq7SH21A9aDIwldHWcH2TNIUi1nSbWoB/qJkmj4nfaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)