UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hc/I9UfL8oJCQVeClKz3qmKzsewTP4lzLEGf41sgIPM='
WHERE
key_id = 'a02f35ce0bf6aa9a347ae82be731708ffb6e0af3d011803601d5f38a8d1efbfb'
AND (
token = 'hc/I9UfL8oJCQVeClKz3qmKzsewTP4lzLEGf41sgIPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)