UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '76TLTs/OZ3chfzN3KikZDbTjqsDhgExy8DblhQiLhn4='
WHERE
key_id = '0ebfd69082689a1e9109d90bad7921728002723859d683a3b7781ff659596020'
AND (
token = '76TLTs/OZ3chfzN3KikZDbTjqsDhgExy8DblhQiLhn4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)