UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0YE4VD8VZ8PdXGwvA/3aGNZgnKj/hmNxC1ed1a9agBg='
WHERE
key_id = '81d41921f7a351808a4615b0387d9a308831a9405dcc0a5472b60aa55cb46ff9'
AND (
token = '0YE4VD8VZ8PdXGwvA/3aGNZgnKj/hmNxC1ed1a9agBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)