UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R2Rw5S+7lfLY72RN/LZI0DumV1XK5HSW2yk24BqjgXE='
WHERE
key_id = 'b37bed22802f0ed72e74f96c949c74dfe7b057ee19eadbd306344cc0ba6d6198'
AND (
token = 'R2Rw5S+7lfLY72RN/LZI0DumV1XK5HSW2yk24BqjgXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)