UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zt0MJQdOEhN4qDHwuiCNpTl9fOcYcnUordW4q/yojH0='
WHERE
key_id = '06c2d464cbbb7191ef2cbdb96133697e78b158d78c25a9868a281c8345d81a88'
AND (
token = 'Zt0MJQdOEhN4qDHwuiCNpTl9fOcYcnUordW4q/yojH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)