UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YHUKnDf+hNY9lfgFfg5xuQHNrt62YCMWxm58Eh+/glM='
WHERE
key_id = '5254efe03dce6eacfd0e00542ca6a59dcca6d710170efdc8cd76650de295d341'
AND (
token = 'YHUKnDf+hNY9lfgFfg5xuQHNrt62YCMWxm58Eh+/glM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)