UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't+3ch9Y7vwek8KFKdbUwNc/D966tvfVTk7rIdKszXD4='
WHERE
key_id = '335e8c52b4791cf03579f78e25d6102a000943950d048c67e154ffe0067af2f7'
AND (
token = 't+3ch9Y7vwek8KFKdbUwNc/D966tvfVTk7rIdKszXD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)